import { RouteObject } from 'react-router-dom';
import { defineRouteConfig, lazy } from 'src/utils';
import { FeatureErrorBoundary } from 'src/feature-antd';

const modules = import.meta.glob('./modules/*/index.tsx', { eager: true });

export const Index: RouteObject = defineRouteConfig(
  {
    path: 'home',
    lazy: lazy(() => import('./element')),
    errorElement: <FeatureErrorBoundary />,
    meta: {
      permissions: ['main'],
    },
  },
  modules,
);

export default Index;
